package com.abbas.myviewtest.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.abbas.myviewtest.R;
import com.abbas.myviewtest.activity.base.BaseActivity;

public class MainActivity extends BaseActivity implements View.OnClickListener{
    private Button btStartGame;
    private Button btScore;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    protected void init() {
        btStartGame = (Button) findViewById(R.id.bt_startGame);
        btScore = (Button) findViewById(R.id.bt_score);

        initEvent();
    }

    private void initEvent(){
        btStartGame.setOnClickListener(this);
        btScore.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.bt_startGame:
                migrateTo(GameActivity.class);
                break;
            case R.id.bt_score:
                migrateTo(ScoreRecordActivity.class);
                break;
        }
    }
}